Skip to content

Bug: ALTER TABLE SET SCHEMA#1409

Merged
kyleconroy merged 2 commits intosqlc-dev:mainfrom
timwmillard:bug/set-schema
Feb 2, 2022
Merged

Bug: ALTER TABLE SET SCHEMA#1409
kyleconroy merged 2 commits intosqlc-dev:mainfrom
timwmillard:bug/set-schema

Conversation

@timwmillard
Copy link
Contributor

@timwmillard timwmillard commented Feb 2, 2022

Once a table schema has been changes via ALTER TABLE <name> SET SCHEMA <new_schema>, any UPDATE queries do not recognise the new table name.

Example:
schema.sql

CREATE SCHEMA foo;
CREATE TABLE bar (name text);
ALTER TABLE bar SET SCHEMA foo;

queries.sql

-- name: UpdateFooBar :exec
UPDATE foo.bar SET name = $1;

The compiler does not recognise the foo.bar table and throws an error.

- `UPDATE` queries do not reconises the new schema.
@kyleconroy kyleconroy merged commit 41b2386 into sqlc-dev:main Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants